<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@taglib prefix="sp" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>${requestScope.data.systemsetting.name}-管理员后台</title>
    <meta name="author" content="${requestScope.data.systemsetting.metaAuthor}"/>
    <meta name="copyright" content="${requestScope.data.systemsetting.metaCopyright}"/>
    <meta name="keywords" content="${requestScope.data.systemsetting.metaKeywords}"/>
    <meta name="description" content="${requestScope.data.systemsetting.metaDescription}"/>
    <link rel="icon" href="${requestScope.data.systemsetting.favicon}" type="image/x-icon"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <script src="http://libs.baidu.com/jquery/1.8.0/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/plugins/validform/js/Validform_v5.3.2_min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/validform/css/style.css"/>

    <!--toastmessage-->
    <script src="${pageContext.request.contextPath}/assets/plugins/toastmessage/javascript/jquery.toastmessage.js"></script>
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/assets/plugins/toastmessage/resources/css/jquery.toastmessage.css"/>

    <!--Easyui-->
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/assets/plugins/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/assets/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/plugins/easyui/themes/bootstrap/easyui.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/plugins/easyui/themes/icon.css"/>

    <!--base-->
    <script src="${pageContext.request.contextPath}/assets/js/base.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/base.css"/>
    <!--nano-->
    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/plugins/nano/nano.js"></script>
</head>

<body class="easyui-layout">
<script>
    var GlobalPermission = {
        permission_add: false,
        permission_edit: false,
        permission_del: false,
        role_del: false,
        role_edit: false,
        role_permission: false,
        menu_edit: false,
        menu_add: false,
        menu_del: false,
        menu_permission: false
    };
    <shiro:hasPermission name="permission:add">
    GlobalPermission.permission_add = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="permission:edit">
    GlobalPermission.permission_edit = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="permission:del">
    GlobalPermission.permission_del = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="role:del">
    GlobalPermission.role_del = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="role:edit">
    GlobalPermission.role_edit = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="menu:edit">
    GlobalPermission.menu_edit = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="menu:add">
    GlobalPermission.menu_add = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="menu:del">
    GlobalPermission.menu_del = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="menu:permission">
    GlobalPermission.menu_permission = true;
    </shiro:hasPermission>
    <shiro:hasPermission name="role:permission">
    GlobalPermission.role_permission = true;
    </shiro:hasPermission>
</script>


<span>
    <span class="error-msg">${requestScope.error}</span>
    <span class="success-msg">${requestScope.success}</span>
</span>

<div data-options="region:'north',title:'North Title',split:true" style="height:100px;">

</div>
<div data-options="region:'west',title:'',split:true" style="width:230px;">
    <div class="subNavBox">
        <c:forEach items="${requestScope.data.menus}" var="menu">
            <c:if test="${fn:length(menu.children)>0}">
                <div class="subNav currentDd currentDt">${menu.name}</div>
                <ul class="navContent">
                    <c:forEach items="${menu.children}" var="subMenu">
                        <li><a href="${pageContext.request.contextPath}${subMenu.url}">${subMenu.name}</a></li>
                    </c:forEach>
                </ul>
            </c:if>
        </c:forEach>
    </div>
    <script>
        var menuShowGlobal = {
            subMenuShow: function (d) {
                $(d).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
                $(d).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
                $(d).next(".navContent").slideToggle(300).siblings(".navContent").slideUp(500);
            },
            subMenuSelect:function(d,b){
                $(d).css({
                    'display': 'block',
                    'height': '28px',
                    'text-align': 'center',
                    'font-size': '14px',
                    'line-height': '28px',
                    'color': '#fff',
                    'background-color': '#277fc2'
                });
                if(b){
                    $(d).attr("selectShow",true);
                }
            }
        };
        $(".subNav").click(function () {
            menuShowGlobal.subMenuShow($(this));
        });
        $('.navContent li a').hover(function () {
           menuShowGlobal.subMenuSelect($(this),false);
        }, function () {
            var isSelected = $(this).attr("selectShow");
            if(isSelected){
               return;
           }
            $(this).removeAttr("selectShow");
            $(this).css({
                'display': 'block',
                'height': '28px',
                'text-align': 'center',
                'font-size': '14px',
                'line-height': '28px',
                'color': '#333',
                'background-color': '#fff'
            });
        });
        //设置菜单展开显示
        top.setMenuActionOpen = function (_param) {
            var _paramlength = arguments.length;
            if (_paramlength <= 0) {
                return;
            }
            var _title = $.trim(arguments[0]);
            var subTitle = arguments[1];
            var firstTitleDiv = $('.subNavBox').find("div.subNav:contains(" + _title + ")");
            menuShowGlobal.subMenuShow(firstTitleDiv);
            var secondTitleA =firstTitleDiv.next("ul.navContent").find("li").find("a:contains(" + subTitle + ")");
            menuShowGlobal.subMenuSelect(secondTitleA,true)
        }
    </script>
</div>
<div data-options="region:'center',title:''">
    <decorator:body></decorator:body>
</div>
</body>

</body>
</html>

<script>
    $("input").filter(function (index) {
        return $(this).attr("selfClass") == undefined;
    }).addClass("input");
</script>